#ifndef EXECUTECONTEXT_H
#define EXECUTECONTEXT_H

#include <map>
#include "..\..\Common\stdafx.h"
#include "..\..\ExecuteRunTimeType.h"

namespace CExpression
{
class ExecuteContext
{
public:
	ExecuteContext():globalTempBoolean(false),globalTempNum(0),errorOccured(false),errorMsg(),boolVariables(),doubleVariables()
	{
	}

	bool GlobalTempBoolean() const
	{
		return this->globalTempBoolean;
	}

	double GlobalTempNum() const
	{
		return this->globalTempNum;
	}

	void SetGlobalTempBoolean(bool val)
	{
		this->globalTempBoolean=val;
	}

	void SetGlobalTempNum(double val)
	{
		this->globalTempNum=val;
	}

	ExecuteRunTimeType TempResultType()
	{
		return this->tempResultType;
	}

	void SetTempResultType(const ExecuteRunTimeType &type)
	{
		this->tempResultType=type;
	}

	bool ErrorOccured()
	{
		return this->errorOccured;
	}

	void SetError()
	{
		this->errorOccured=true;
	}

	void ResetError()
	{
		this->errorOccured=false;
	}

	ExpressionString ErrorMsg()
	{
		return this->errorMsg;
	}

	void SetErrorMsg(const ExpressionString& msg)
	{
		this->errorMsg=msg;
	}

	std::map<ExpressionString,bool>& BoolVariables()
	{
		return this->boolVariables;
	}

	std::map<ExpressionString,double>& DoubleVariables()
	{
		return this->doubleVariables;
	}
private:
	bool globalTempBoolean;
	double globalTempNum;
	ExecuteRunTimeType tempResultType;
	bool errorOccured;
	ExpressionString errorMsg;
	std::map<ExpressionString,bool> boolVariables;
	std::map<ExpressionString,double> doubleVariables;
};
}

#endif